Emulator.Components
Class Flag
java.lang.Object
Emulator.Components.Component
Emulator.Components.Flag
- All Implemented Interfaces:
- DataComponent, Constants
public class Flag
- extends Component
- implements DataComponent
**********************
Created By: Yuval Tzur
Date: 14/12/12
Time: 23:21
Description: This class represents a 1-bit flag. A flag is a component.
A flag has a boolean value and a change of state flag that indicates that the flag was set since the last time its value was checked.
The boolean value has a buffer to mimic the master-slave functionality of real flip-flops.
The change of state flag is set to true when the flag is set to true, and resets when the flag is read.
Values are set to the buffer and read from the value. An update method will move the value from the buffer to the value.
***********************
| Fields inherited from interface Emulator.Global.Constants |
_0, _1, AC, ADDR_REGISTER_SIZE, ALU, ALU_IN0, ALU_IN1, ALU_OUT, AR, BUS, BUS_SIZE, DATA_COMPONENTS, DATA_REGISTER_SIZE, DATA_TABLE_SIZE, DR, E, FGI, FGO, I, IEN, INPR, IO_REGISTER_SIZE, IR, M, MEMORY_SIZE, OUTR, PC, R, S, TARGET_REACHED, TIMEOUT, TIMER, TIMER_LIMIT, TR, TR0, TR1, UNREACHABLE |
|
Constructor Summary |
Flag(int id,
java.lang.String name)
|
|
Method Summary |
void |
and()
|
boolean |
changed()
|
void |
clear()
|
void |
complement()
|
void |
complement0()
|
void |
complement1()
|
void |
disableWrite()
|
void |
disableWrite0()
|
void |
disableWrite1()
|
void |
divide()
|
void |
enableWrite()
|
void |
enableWrite0()
|
void |
enableWrite1()
|
void |
equal()
|
boolean |
evaluateAsBoolean()
|
boolean |
evaluateAsBoolean(int bitIndex)
|
boolean |
evaluateAsBoolean(int bitStart,
int bitEnd)
|
int |
get_decimal()
|
int |
get_decimal(int bitIndex)
|
int |
get_decimal(int bitStart,
int bitEnd)
|
DataComponent |
get_input0()
|
DataComponent |
get_input1()
|
DataComponent |
get_output()
|
Value |
get_row(int address)
|
Value |
get_value()
|
Value |
get_value(int index)
|
Value |
get_value(int start,
int end)
|
void |
greaterOrEqual()
|
void |
greaterThan()
|
void |
increment()
|
boolean |
isWritable()
|
boolean |
isWritable0()
|
boolean |
isWritable1()
|
void |
lessOrEqual()
|
void |
lessThan()
|
void |
modulo()
|
void |
multiply()
|
void |
notEqual()
|
void |
or()
|
void |
passThrough0()
|
void |
passThrough1()
|
void |
set_value(int start,
int end,
Value value)
|
void |
set_value(int index,
Value value)
|
void |
set_value(Value value)
|
void |
set()
|
void |
shiftLeft0(int numOfBits,
boolean filler)
|
void |
shiftLeft1(int numOfBits,
boolean filler)
|
void |
shiftRight0(int numOfBits,
boolean filler)
|
void |
shiftRight1(int numOfBits,
boolean filler)
|
void |
subtract()
|
void |
sum()
|
void |
update()
|
void |
xor()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Flag
public Flag(int id,
java.lang.String name)
set_value
public void set_value(Value value)
- Specified by:
set_value in interface DataComponent
get_value
public Value get_value()
- Specified by:
get_value in interface DataComponent
get_input0
public DataComponent get_input0()
- Specified by:
get_input0 in interface DataComponent
get_input1
public DataComponent get_input1()
- Specified by:
get_input1 in interface DataComponent
get_output
public DataComponent get_output()
- Specified by:
get_output in interface DataComponent
evaluateAsBoolean
public boolean evaluateAsBoolean(int bitIndex)
- Specified by:
evaluateAsBoolean in interface DataComponent
evaluateAsBoolean
public boolean evaluateAsBoolean(int bitStart,
int bitEnd)
- Specified by:
evaluateAsBoolean in interface DataComponent
isWritable
public boolean isWritable()
- Specified by:
isWritable in interface DataComponent
isWritable0
public boolean isWritable0()
- Specified by:
isWritable0 in interface DataComponent
isWritable1
public boolean isWritable1()
- Specified by:
isWritable1 in interface DataComponent
get_value
public Value get_value(int start,
int end)
- Specified by:
get_value in interface DataComponent
get_value
public Value get_value(int index)
- Specified by:
get_value in interface DataComponent
get_row
public Value get_row(int address)
- Specified by:
get_row in interface DataComponent
set_value
public void set_value(int index,
Value value)
- Specified by:
set_value in interface DataComponent
set_value
public void set_value(int start,
int end,
Value value)
- Specified by:
set_value in interface DataComponent
enableWrite
public void enableWrite()
- Specified by:
enableWrite in interface DataComponent
enableWrite0
public void enableWrite0()
- Specified by:
enableWrite0 in interface DataComponent
enableWrite1
public void enableWrite1()
- Specified by:
enableWrite1 in interface DataComponent
disableWrite
public void disableWrite()
- Specified by:
disableWrite in interface DataComponent
disableWrite0
public void disableWrite0()
- Specified by:
disableWrite0 in interface DataComponent
disableWrite1
public void disableWrite1()
- Specified by:
disableWrite1 in interface DataComponent
increment
public void increment()
- Specified by:
increment in interface DataComponent
passThrough0
public void passThrough0()
- Specified by:
passThrough0 in interface DataComponent
passThrough1
public void passThrough1()
- Specified by:
passThrough1 in interface DataComponent
sum
public void sum()
- Specified by:
sum in interface DataComponent
subtract
public void subtract()
- Specified by:
subtract in interface DataComponent
multiply
public void multiply()
- Specified by:
multiply in interface DataComponent
divide
public void divide()
- Specified by:
divide in interface DataComponent
modulo
public void modulo()
- Specified by:
modulo in interface DataComponent
and
public void and()
- Specified by:
and in interface DataComponent
or
public void or()
- Specified by:
or in interface DataComponent
xor
public void xor()
- Specified by:
xor in interface DataComponent
equal
public void equal()
- Specified by:
equal in interface DataComponent
notEqual
public void notEqual()
- Specified by:
notEqual in interface DataComponent
greaterThan
public void greaterThan()
- Specified by:
greaterThan in interface DataComponent
lessThan
public void lessThan()
- Specified by:
lessThan in interface DataComponent
greaterOrEqual
public void greaterOrEqual()
- Specified by:
greaterOrEqual in interface DataComponent
lessOrEqual
public void lessOrEqual()
- Specified by:
lessOrEqual in interface DataComponent
complement0
public void complement0()
- Specified by:
complement0 in interface DataComponent
complement1
public void complement1()
- Specified by:
complement1 in interface DataComponent
shiftLeft0
public void shiftLeft0(int numOfBits,
boolean filler)
- Specified by:
shiftLeft0 in interface DataComponent
shiftLeft1
public void shiftLeft1(int numOfBits,
boolean filler)
- Specified by:
shiftLeft1 in interface DataComponent
shiftRight0
public void shiftRight0(int numOfBits,
boolean filler)
- Specified by:
shiftRight0 in interface DataComponent
shiftRight1
public void shiftRight1(int numOfBits,
boolean filler)
- Specified by:
shiftRight1 in interface DataComponent
get_decimal
public int get_decimal(int bitIndex)
- Specified by:
get_decimal in interface DataComponent
get_decimal
public int get_decimal(int bitStart,
int bitEnd)
- Specified by:
get_decimal in interface DataComponent
evaluateAsBoolean
public boolean evaluateAsBoolean()
- Specified by:
evaluateAsBoolean in interface DataComponent
get_decimal
public int get_decimal()
- Specified by:
get_decimal in interface DataComponent
set
public void set()
- Specified by:
set in interface DataComponent
clear
public void clear()
- Specified by:
clear in interface DataComponent
complement
public void complement()
- Specified by:
complement in interface DataComponent
changed
public boolean changed()
- Specified by:
changed in interface DataComponent
update
public void update()
- Specified by:
update in interface DataComponent